<?php 
require_once('../head/nav.php'); 
?>

    <div class="col-sm-9 col-md-10">

<form method=POST action="search.php">
<table align="center" width="80%">
 <tr>
  <td><h4><center><a href="admin.php?c=co&m=coform">添加合作项目相关信息</br></a></center></h4></td>
</tr>
</form>

<h1 class="text-center">合作相关管理</h1>
    <table class="table table-hover"> 
    <!-- 通过添加 .table-hover 类可以让 <tbody> 中的每一行对鼠标悬停状态作出响应。 -->
      <tr class="success">
        <th>合作编号</th>
        <th>合作项目</th>   
        <th>联系方式</th>
        <th>合作简介</th>
        <th>操作</th>
      </tr>
    </div>
  </div>
</div>

<?php
  static $count=0;
  if(array_key_exists('coid',$data['cooperate'])){
    $count=1;
    $row = $data['cooperate'];
    echo '<tr>';
    echo '<td>'.$row['coid'].'</td>';
    echo '<td>'.$row['coproject'].'</td>';
    echo '<td>'.$row['phone'].'</td>';  
    echo '<td>'.$row['cointro'].'</td>';
    echo '<td><a href="Admin.php?c=co&m=cooedit&id='.$row['coid'].' ">修改</a> | 
    <a href="Admin.php?c=co&m=delco&id='.$row['coid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
    echo '</tr>';
  }else{
    foreach ($data['cooperate'] as $row)
    {
      $count++;
      echo '<tr>';
      echo '<td>'.$row['coid'].'</td>';
      echo '<td>'.$row['coproject'].'</td>';
      echo '<td>'.$row['phone'].'</td>';  
      echo '<td>'.$row['cointro'].'</td>';
      echo '<td><a href="Admin.php?c=co&m=cooedit&id='.$row['coid'].' ">修改</a> | 
      <a href="Admin.php?c=co&m=delco&id='.$row['coid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
      echo '</tr>';
    }
  }
  echo '</table>';  
  echo "<table align='center'><tr><td>共有{$count}个合作项目</td></tr></table>";   
?>

</div> 
<?php require_once('../head/footer.php'); ?>